package com.itheima.bean;

public class Stock {
    //库存数量
    private static int  num=1;
    //减少库存
    public  boolean reduceStock(){
        if(num>0)
        {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            num--;
            return true;
        }else
        {
            return false;
        }
    }
}
